home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
201-225
/
225
/
amigatcp
/
src
/
ether.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-13
|
709b
|
37 lines
/* Stuff generic to all Ethernet controllers */
#include "machdep.h"
char ether_bdcst[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
/* Format an Ethernet address into a printable ascii string */
pether(out,addr)
char *out,*addr;
{
sprintf(out,"%02x:%02x:%02x:%02x:%02x:%02x",
addr[0] & 0xff,
addr[1] & 0xff,
addr[2] & 0xff,
addr[3] & 0xff,
addr[4] & 0xff,
addr[5] & 0xff,
addr[6] & 0xff);
}
/* Convert an Ethernet address from Hex/ASCII to binary */
gether(out,cp)
register char *out;
register char *cp;
{
register int i;
char *index();
for(i=6; i!=0; i--){
*out++ = htoi(cp);
if((cp = index(cp,':')) == NULLCHAR) /* Find delimiter */
break;
cp++; /* and skip over it */
}
}